const { defineConfig } = require('@vue/cli-service')
const path = require('path')
module.exports = defineConfig({
  transpileDependencies: true,
  // devServer: {
  //   proxy: {
  //     '/api': {
  //       target: "http://merchant-test.ahurepair.cn/logis-merchant/",
  //      // "http://wc.0123china.cn"
  //       changeOrigin: true,
  //       ws:true,
  //       pathRewrite: {'^/api': '' }
  //     }
  //   }
  // },
  productionSourceMap: false,
  css: {
    loaderOptions: {
      sass: {
        sassOptions: {
          outputStyle: 'expanded'
        }
      }
    }
  },
  lintOnSave: false,
  // 自定义路径别名
  chainWebpack: config => {
    config.resolve.alias
      .set('@', path.join(__dirname, 'src'))
      .set('_views', path.join(__dirname, 'src/views'))
      .set('_components', path.join(__dirname, 'src/components'))
      .set('@utils', path.join(__dirname, 'src/utils'))
      .set('_api', path.join(__dirname, 'src/api'))
      .set('@packages', path.join(__dirname, 'src/packages'))
  }
})
